<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>v-model双向数据绑定</title>
</head>
<body>
<div id="app">
    <span>{{msg}}</span>
    <input type="text" v-model="msg" value="msg"/>
    <hr>
    <input type="button" value="改变data中的值" @click="changeValue">
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: "#app",
        data: {
            msg:"nihaoya"
        },
        methods: {
            changeValue() {
                this.msg = "ssssss";
            }
        },
    });
</script>
</html>
